package com.umeox.watch.moto.dataservice.db.dao;


import android.database.Cursor;

import androidx.annotation.NonNull;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.umeox.watch.moto.dataservice.db.model.LocationInfo;

import java.util.List;

@Dao
public interface LocationInfoDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    long save(@NonNull LocationInfo locationInfo);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(List<LocationInfo> locationInfoList);

    @Update(onConflict = OnConflictStrategy.REPLACE)
    int update(LocationInfo locationInfo);

    @Delete
    int delete(LocationInfo locationInfo);

    @Delete
    void delete(List<LocationInfo> items);

    @Query("DELETE FROM location_record")
    int deleteAll();

    @Query("SELECT * FROM location_record")
    Cursor query();
}
